/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gray.swing.frame;

import java.awt.BorderLayout;
import java.awt.Container;
import javax.swing.JPanel;
import gray.Frame;

/**
 *
 * @author martin
 */
public class RightColumnFrame extends JPanel implements Frame<Container>{
    private final Frame<Container> _rightCol,
                                   _rest;
    
    private RightColumnFrame(final Frame<Container> rightCol, final Frame<Container> rest){
        super(new BorderLayout());
        add(rightCol.container(),BorderLayout.EAST);
        add(rest.container(),BorderLayout.CENTER);
        _rightCol=rightCol;
        _rest=rest;
    }

    public static Frame<Container> factory(final Frame<Container> rightCol, final Frame<Container> rest){
        return new RightColumnFrame(rightCol, rest);
    }
    
    @Override
    public Container container() {
        return this;
    }
    
    @Override
    public Boolean ready() {
        return _rightCol.ready() && _rest.ready();
    }
}
